package com.vcc.service.impl;

import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.vcc.data.entity.UserRole;
import com.vcc.data.mapper.UserRoleMapper;
import com.vcc.service.service.UserRoleService;
import org.springframework.stereotype.Service;

import java.util.List;

import static com.vcc.data.entity.table.UserRoleTableDef.USER_ROLE;

@Service
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements UserRoleService {
    @Override
    public List<Long> listUserIdByRoleId(Long roleId) {
        return listAs(query().select(USER_ROLE.USER_ID).where(USER_ROLE.ROLE_ID.eq(roleId)), Long.class);
    }
}
